package com.vcms.cms.entity;

import java.sql.Timestamp;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Config entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "config", catalog = "vcms_0.1")
public class Config implements java.io.Serializable {

	// Fields

	private Integer configId;
	private Site site;
	private String contextPath;
	private String servletPoint;
	private Integer port;
	private String dbFileUrl;
	private Boolean isUploadToDb;
	private String defImg;
	private String loginUrl;
	private String processUrl;
	private Date contClearTime;
	private Date countCopyTime;
	private String downloadCode;
	private Timestamp downloadTime;
	private String emailHost;
	private String emailEconding;
	private String emailUserName;
	private String emailPassword;
	private String emailPersonal;
	private Boolean emailValidate;
	private Set<ConfigAttr> configAttrs = new HashSet<ConfigAttr>(0);

	// Constructors

	/** default constructor */
	public Config() {
	}

	/** full constructor */
	public Config(Site site, String contextPath, String servletPoint,
			Integer port, String dbFileUrl, Boolean isUploadToDb,
			String defImg, String loginUrl, String processUrl,
			Date contClearTime, Date countCopyTime, String downloadCode,
			Timestamp downloadTime, String emailHost, String emailEconding,
			String emailUserName, String emailPassword, String emailPersonal,
			Boolean emailValidate, Set<ConfigAttr> configAttrs) {
		this.site = site;
		this.contextPath = contextPath;
		this.servletPoint = servletPoint;
		this.port = port;
		this.dbFileUrl = dbFileUrl;
		this.isUploadToDb = isUploadToDb;
		this.defImg = defImg;
		this.loginUrl = loginUrl;
		this.processUrl = processUrl;
		this.contClearTime = contClearTime;
		this.countCopyTime = countCopyTime;
		this.downloadCode = downloadCode;
		this.downloadTime = downloadTime;
		this.emailHost = emailHost;
		this.emailEconding = emailEconding;
		this.emailUserName = emailUserName;
		this.emailPassword = emailPassword;
		this.emailPersonal = emailPersonal;
		this.emailValidate = emailValidate;
		this.configAttrs = configAttrs;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "configId", unique = true, nullable = false)
	public Integer getConfigId() {
		return this.configId;
	}

	public void setConfigId(Integer configId) {
		this.configId = configId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "siteId")
	public Site getSite() {
		return this.site;
	}

	public void setSite(Site site) {
		this.site = site;
	}

	@Column(name = "contextPath", length = 50)
	public String getContextPath() {
		return this.contextPath;
	}

	public void setContextPath(String contextPath) {
		this.contextPath = contextPath;
	}

	@Column(name = "servletPoint", length = 50)
	public String getServletPoint() {
		return this.servletPoint;
	}

	public void setServletPoint(String servletPoint) {
		this.servletPoint = servletPoint;
	}

	@Column(name = "port")
	public Integer getPort() {
		return this.port;
	}

	public void setPort(Integer port) {
		this.port = port;
	}

	@Column(name = "dbFileUrl", length = 100)
	public String getDbFileUrl() {
		return this.dbFileUrl;
	}

	public void setDbFileUrl(String dbFileUrl) {
		this.dbFileUrl = dbFileUrl;
	}

	@Column(name = "isUploadToDb")
	public Boolean getIsUploadToDb() {
		return this.isUploadToDb;
	}

	public void setIsUploadToDb(Boolean isUploadToDb) {
		this.isUploadToDb = isUploadToDb;
	}

	@Column(name = "defImg", length = 300)
	public String getDefImg() {
		return this.defImg;
	}

	public void setDefImg(String defImg) {
		this.defImg = defImg;
	}

	@Column(name = "loginUrl", length = 300)
	public String getLoginUrl() {
		return this.loginUrl;
	}

	public void setLoginUrl(String loginUrl) {
		this.loginUrl = loginUrl;
	}

	@Column(name = "processUrl", length = 300)
	public String getProcessUrl() {
		return this.processUrl;
	}

	public void setProcessUrl(String processUrl) {
		this.processUrl = processUrl;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "contClearTime", length = 10)
	public Date getContClearTime() {
		return this.contClearTime;
	}

	public void setContClearTime(Date contClearTime) {
		this.contClearTime = contClearTime;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "countCopyTime", length = 10)
	public Date getCountCopyTime() {
		return this.countCopyTime;
	}

	public void setCountCopyTime(Date countCopyTime) {
		this.countCopyTime = countCopyTime;
	}

	@Column(name = "downloadCode", length = 100)
	public String getDownloadCode() {
		return this.downloadCode;
	}

	public void setDownloadCode(String downloadCode) {
		this.downloadCode = downloadCode;
	}

	@Column(name = "downloadTime", length = 19)
	public Timestamp getDownloadTime() {
		return this.downloadTime;
	}

	public void setDownloadTime(Timestamp downloadTime) {
		this.downloadTime = downloadTime;
	}

	@Column(name = "emailHost", length = 100)
	public String getEmailHost() {
		return this.emailHost;
	}

	public void setEmailHost(String emailHost) {
		this.emailHost = emailHost;
	}

	@Column(name = "emailEconding", length = 30)
	public String getEmailEconding() {
		return this.emailEconding;
	}

	public void setEmailEconding(String emailEconding) {
		this.emailEconding = emailEconding;
	}

	@Column(name = "emailUserName", length = 200)
	public String getEmailUserName() {
		return this.emailUserName;
	}

	public void setEmailUserName(String emailUserName) {
		this.emailUserName = emailUserName;
	}

	@Column(name = "emailPassword", length = 200)
	public String getEmailPassword() {
		return this.emailPassword;
	}

	public void setEmailPassword(String emailPassword) {
		this.emailPassword = emailPassword;
	}

	@Column(name = "emailPersonal", length = 100)
	public String getEmailPersonal() {
		return this.emailPersonal;
	}

	public void setEmailPersonal(String emailPersonal) {
		this.emailPersonal = emailPersonal;
	}

	@Column(name = "emailValidate")
	public Boolean getEmailValidate() {
		return this.emailValidate;
	}

	public void setEmailValidate(Boolean emailValidate) {
		this.emailValidate = emailValidate;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "config")
	public Set<ConfigAttr> getConfigAttrs() {
		return this.configAttrs;
	}

	public void setConfigAttrs(Set<ConfigAttr> configAttrs) {
		this.configAttrs = configAttrs;
	}

}